from command import Command

__all__ = [
    "Stereo", "StereoOnCommand", "StereoOffCommand",
    "StereoOnWithCDCommand"
]

class Stereo:
    def __init__(self, location: str):
        self._location = location

    def on(self):
        print(f"{self._location} stereo is on")

    def off(self):
        print(f"{self._location} stereo is off")

    def set_cd(self):
        print(f"{self._location} stereo is set for CD input")

    def set_dvd(self):
        print(f"{self._location} stereo is set for DVD input")

    def set_radio(self):
        print(f"{self._location} stereo is set for Radio")

    def set_volume(self, volume: int):
        print(f"{self._location} stereo volume set to {volume}")



class StereoOnWithCDCommand(Command):
    def __init__(self, stereo: Stereo):
        self._stereo = stereo

    def execute(self):
        self._stereo.on()
        self._stereo.set_cd()
        self._stereo.set_volume(11)

    def undo(self):
        self._stereo.off()


class StereoOffCommand(Command):
    def __init__(self, stereo: Stereo):
        self._stereo = stereo

    def execute(self):
        self._stereo.off()

    def undo(self):
        self._stereo.on()


class StereoOnCommand(Command):
    def __init__(self, stereo: Stereo):
        self._stereo = stereo

    def execute(self):
        self._stereo.on()

    def undo(self):
        self._stereo.off()